package com.cloud.force.api.handler;

import org.springframework.context.ApplicationContext;

public abstract class SurroundHandler implements Handler{
	@Override
	public void handler(Request request, Response resp, HandlerChain chain) {
		ApplicationContext context = chain.getApplicationContext();
		this.beforeHandler(request, resp, context);
		chain.doHandler(request, resp);
		this.afterHandler(request, resp, context);
	}
	
	public abstract void afterHandler(Request request, Response resp, ApplicationContext context);
	
	public abstract void beforeHandler(Request request, Response resp, ApplicationContext context);
}
